const orderModel = require('../../model/mall/order');
async function addOrder(req, res) {
    const result = await orderModel.addOrder(req.body);
    const json = result;
    res.send(json)
}
async function getAllOrder(req, res) {
    const result = await orderModel.getAllOrder(req.query.userID);
    const json = result;
    res.send(json)
}
async function getDetail(req, res) {
    const result = await orderModel.getDetail(req.query);
    console.log('req.query: ', req.query);
    const json = result;
    res.send(json)
}
async function cancelOrder(req, res) {
    const result = await orderModel.cancelOrder(req.id);
    const json = result;
    res.send(json)
}
module.exports = {
    addOrder,
    getAllOrder,
    getDetail,
    cancelOrder
}